#ifndef APP_WIFI_H_My
#define APP_WIFI_H_My

#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"
#include "esp_system.h"

#include "esp_wifi.h"
#include "esp_spi_flash.h"

#include "esp_event.h"
#include "esp_log.h"
#include "nvs_flash.h"
#include "esp_smartconfig.h"

#include "lwip/err.h"
#include "lwip/sys.h"

// #define EXAMPLE_ESP_WIFI_SSID      "Canon"
// #define EXAMPLE_ESP_WIFI_PASS      "11111112"



/* 宏定义WiFi更新标识码、WiFi名称和密码 */
#define MY_WIFI_UPDATE  4097                /* 对数值进行修改表示更新NVS的WiFi名称和密码*/
#define MY_WIFI_SSID    "Canon"
#define MY_WIFI_PASSWD  "11111112"

#define WIFI_CONNECTED_BIT BIT0
#define WIFI_FAIL_BIT      BIT1
#define SMART_CONFIG_BIT   BIT2

//最大重连次数
#define EXAMPLE_ESP_MAXIMUM_RETRY  CONFIG_ESP_MAXIMUM_RETRY


//extern EventGroupHandle_t s_wifi_event_group;

void wifi_connect_init(void);
void wifi_init_sta(void);

//static void smartconfig_init_start();
static void event_handler(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data);
static void smartconfig_task();

#endif